import { request } from '@boeyo/portal';

/**
 * 测点列表
 * null
 */
export const fetchList = (params) => {
  return request({
    url: 'bimface/list',
    params,
  });
};

/**
 * 监测列表树形列表
 * null
 */
export const fetchStructureTree = (data = {}) => {
  return request({
    url: '/monitoring/tree',
    method: 'POST',
    data,
  });
};

/**
 * 项目下拉列表
 * @ss.hasPermi('manufacturer:selectList')
 */
export const projectSelectList = () => {
  return request({
    url: 'project/selectList',
    method: 'GET',
  });
};

/**
 * 删除背景图和描点信息
 * null
 */
export const deleteMeasure = (id) => {
  return request({
    url: `/measuring/delete/${id}`,
    method: 'POST',
  });
};

/**
 * 通用上传请求（单个）
 */
export const uploadFile = (data) => {
  return request({
    url: '/common/upload',
    method: 'POST',
    data,
  });
};

/**
 * 上传预览图
 */
export const uploadScene = (data) => {
  return request({
    url: 'scene2d/upload',
    method: 'POST',
    data,
  });
};

/**
 * 上传预览图
 */
export const preview = (id) => {
  return request({
    url: `scene2d/preview/${id}`,
  });
};

/**
 * 获取文件直传的policy凭证
 */
export const getFileUploadPolicy = (data?) => {
  return request({
    url: '/bimface/getFileUploadPolicy',
    method: 'POST',
    data,
  });
};

/**
 * 获取文件直传的policy凭证
 */
export const getFileUpdatePolicy = (data?) => {
  return request({
    url: '/bimface/getFileUpdatePolicy',
    method: 'POST',
    data,
  });
};

/**
 * 绑定bim和监测阵
 */
export const bindStructure = (data?) => {
  return request({
    url: '/bimface/bindStructure',
    method: 'POST',
    data,
  });
};

/**
 * 发起模型转换
 */
export const translate = (data?) => {
  return request({
    url: '/bimface/translate',
    method: 'POST',
    data,
  });
};
/**
 * 删除模型文件
 */
export const deleteFiles = (data) => {
  return request({
    url: '/bimface/deleteFiles',
    method: 'POST',
    data,
  });
};
